<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class MenuActionSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('menu_actions')->insert(array(
            //项目列表
            ['id' => 1, 'menu_id' => 15, 'title' => '添加项目', 'code' => 'projectList.add', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 2, 'menu_id' => 15, 'title' => '编辑项目', 'code' => 'projectList.edit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 3, 'menu_id' => 15, 'title' => '启动项目', 'code' => 'projectList.start', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 4, 'menu_id' => 15, 'title' => '结束项目', 'code' => 'projectList.stop', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 5, 'menu_id' => 15, 'title' => '删除项目', 'code' => 'projectList.delete', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 6, 'menu_id' => 15, 'title' => '展示项目', 'code' => 'projectList.show', 'description' => '链接', 'created_at' => DB::raw('now()')],
            ['id' => 7, 'menu_id' => 15, 'title' => '添加项目版本', 'code' => 'projectList.versionAdd', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 8, 'menu_id' => 15, 'title' => '展示项目版本', 'code' => 'projectList.versionShow', 'description' => '链接', 'created_at' => DB::raw('now()')],
            ['id' => 9, 'menu_id' => 15, 'title' => '编辑项目版本', 'code' => 'projectList.versionEdit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 10, 'menu_id' => 15, 'title' => '删除项目版本', 'code' => 'projectList.versionDelete', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 11, 'menu_id' => 15, 'title' => '项目列表', 'code' => 'projectList.list', 'description' => '后台', 'created_at' => DB::raw('now()')],
            //添加项目
            ['id' => 0, 'menu_id' => 16, 'title' => '创建项目', 'code' => 'projectAdd.create', 'description' => '后台', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '编辑项目', 'code' => 'projectAdd.edit', 'description' => '后台', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '编辑项目中心', 'code' => 'projectAdd.centerEdit', 'description' => '后台', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '添加项目分组', 'code' => 'projectAdd.groupAdd', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '编辑项目分组', 'code' => 'projectAdd.groupEdit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '删除项目分组', 'code' => 'projectAdd.groupDelete', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 16, 'title' => '上传项目附件', 'code' => 'projectAdd.attachmentUpload', 'description' => '功能', 'created_at' => DB::raw('now()')],
            //编辑项目
            ['id' => 0, 'menu_id' => 17, 'title' => '编辑项目', 'code' => 'projectEdit.edit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '编辑项目中心', 'code' => 'projectEdit.centerEdit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '添加项目分组', 'code' => 'projectEdit.groupAdd', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '编辑项目分组', 'code' => 'projectEdit.groupEdit', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '删除项目分组', 'code' => 'projectEdit.groupDelete', 'description' => '按钮', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '上传项目附件', 'code' => 'projectEdit.attachmentUpload', 'description' => '功能', 'created_at' => DB::raw('now()')],
            ['id' => 0, 'menu_id' => 17, 'title' => '删除项目附件', 'code' => 'projectEdit.attachmentDelete', 'description' => '功能', 'created_at' => DB::raw('now()')],
        ));

        DB::table('menu_action_map_permission')->insert(array(
            ['action_id' => 1, 'permission_id' => 1, 'created_at' => DB::raw('now()')],
            ['action_id' => 1, 'permission_id' => 2, 'created_at' => DB::raw('now()')]
        ));
    }

}
